#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int n,x=100,k, ans;
	cin >> n;
	n /= 52;
	k = (n - x * 7);
		for (x = 100; x >= 0; x--)
		{
			if (k % 21 == 0)
			{
				if (k > 0 && 0 < x && x < 100)
				{
					cout << x << endl << (k / 21);
					break;
				}
			}
		}
	return 0;
}